<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<html>
<head>
    <title>江苏高考志愿填报系统</title>
</head>
<link rel="stylesheet" href="css/style.css" >
<link href='css/jquery.tableui.css'  rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="css/bootstrap.min.css" >
<script type="text/javascript" src="js/jquery-3.3.1.js"></script>
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery-nav.js"></script>
<script type="text/javascript" src="js/jquery.tableui.js"></script>
<body style="background-color: #3ea751">
<%--头部div--%>
<div class="box">
    <ul class="f-nav" id='f-nav'>
        <a onclick="javascript:Check();"><li>首页</li></a>
        <a href="/school_search"><li>高校信息查询</li></a>
        <a onclick="javascript:Foo();"><li>考生志愿填报</li></a>
        <a href="/show_vol"><li>志愿填报查询</li></a>
        <div class='sideline'></div>
    </ul>
</div>
<div style="margin: 10px 200px; width:74%;">
    <c:if test="${empty showlist}">
        <div style="width: 100%; height: 300px; background-color: #b4dbed">
            <span style="font-size: 20px;position: relative;left: 50px;top: 30px">查询如下：</span><br>
            <div style=" width:48%; font-size: 40px; position: relative; top: 100px; margin: 0 auto">未查询到您的填报记录</div>
        </div>
    </c:if>
    <c:if test="${not empty showlist}">
        <table class="table_solid" border="0" cellspacing="0" cellpadding="0" style="width: 100%; text-align: center">
            <tr>
                <td rowspan="5" style="height: 40px">${showlist.sch_id[0]}</td>
                <td rowspan="5" style="height: 40px">${showlist.sch_names[0]}</td>
                <c:forEach items="${showlist.majors[0]}" var="list">
                    <td style="height: 40px">${list}</td></tr><tr>
                </c:forEach>

                <td rowspan="5" style="height: 40px">${showlist.sch_id[1]}</td>
                <td rowspan="5" style="height: 40px">${showlist.sch_names[1]}</td>
                <c:forEach items="${showlist.majors[1]}" var="list">
                    <td style="height: 40px">${list}</td></tr>
            <tr>
                </c:forEach>

                <td rowspan="5" style="height: 40px">${showlist.sch_id[2]}</td>
                <td rowspan="5" style="height: 40px">${showlist.sch_names[2]}</td>
                <c:forEach items="${showlist.majors[2]}" var="list">
                    <td style="height: 40px">${list}</td></tr>
                </c:forEach>
        </table>
    </c:if>
</div>
</body>
<script>
    $('#f-nav').tooltip({
        default: 4,       // 默认为空  --  选中默认值
        width: '200',     // 限制宽度
        height: '100',
        type: 'slideMove',  // 必填, 选择内容
        success: function(ret){

        }   //初始化回调
    });
    function Check(){
        var user = ${loginUser.stu_id};
        if(user == null || user == ''){
            $(window).attr('location','/init');
        }
        $(window).attr('location','/main');
    }
    function Foo(){
        var mydate = new Date();
        var str = "" + mydate.getFullYear() + "-";
        str += (mydate.getMonth()+1) + "-";
        str += mydate.getDate();
        var now = new Date(str);
        var fixtime = new Date("2018-06-28");
        if(now>fixtime){
            swal("志愿填报时间已过");
            return false;
        }
        if(${empty loginUser}){
            $(window).attr('location','/init');
        }
        $.post("check_vol",{"stu_id":${loginUser.stu_id}},function(data){
            if(data == "false"){
                swal("您已经填写过志愿信息！");
            }
            else{
                $(window).attr('location','/tian_bao');
            }
        })
    }
    $(function(){
        $(".table_solid").tableUI();
    })
</script>
</html>
